Various upgrade/fixes from Technux
v3 cover Various upgrade/fixes from Technux
Various fixes from Technux, with focus on PiTFT support.
Petter Mabäcker (6):
README: Add SPI bus chapter to content
.gitignore: Ignore .swp files
rpi-config: I2C support
rpi-base.inc: Allow MACHINE_FEATURES appends
pitft: Add basic support for PiTFT
pitft: Add PiTFT22 support
.gitignore | 1 + README | 55 ++++++++--- conf/machine/include/rpi-base.inc | 3 +- recipes-bsp/bootfiles/rpi-config_git.bb | 17 +++- .../rpi/xorg.conf.d/99-pitft.conf | 5 + .../xorg-xserver/xserver-xf86-config_0.1.bbappend | 11 ++- recipes-kernel/linux/linux-raspberrypi.inc | 6 +- ...dts-add-overlay-for-pitft22-in-linux-3.18.patch | 110 +++++++++++++++++++++ .../0001-dts-add-overlay-for-pitft22.patch | 110 +++++++++++++++++++++ recipes-kernel/linux/linux-raspberrypi_3.18.bb | 5 +- recipes-kernel/linux/linux-raspberrypi_4.1.bb | 4 +- 11 files changed, 306 insertions(+), 21 deletions(-) create mode 100644 recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-pitft.conf create mode 100644 recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch create mode 100644 recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22.patch
Signature · 1 line
1.9.1
PATCH v3 1/6 README: Add SPI bus chapter to content
The optional SPI bus chapter was missing in the content list.
While at it also place it together with the other "optional" chapters, instead of in the end.
--- README | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
README +15 -13
@@ -20,10 +20,11 @@ Contents: 2.F. Optional - Video camera support with V4L2 drivers 2.G. Optional - Enable offline compositing support 2.H. Optional - Enable kgdb over console support - 2.I. Images - 2.J. Boot to U-Boot - 2.K. Image with Initramfs - 2.L. Device tree support + 2.I. Optional - Enable SPI bus + 2.J. Images + 2.K. Boot to U-Boot + 2.L. Image with Initramfs + 2.M. Device tree support 3. Extra apps 3.A. omxplayer 4. Source code and mirrors
@@ -145,7 +146,13 @@ To add the kdbg over console (kgdboc) parameter to the kernel command line, set this variable in local.conf: ENABLE_KGDB = "1" -2.I. Images +2.I. Optional - Enable SPI bus +============================== +When using device tree kernels, set this variable to enable the SPI bus +ENABLE_SPI_BUS = "1" + + +2.J. Images =========== * rpi-hwup-image Hardware up image
@@ -155,7 +162,7 @@ ENABLE_KGDB = "1" Image based on rpi-basic-image which includes most of the packages in this layer and some media samples. -2.J. Boot to U-Boot +2.K. Boot to U-Boot =================== To have u-boot load kernel image, set in your local.conf KERNEL_IMAGETYPE = "uImage"
@@ -163,7 +170,7 @@ KERNEL_IMAGETYPE = "uImage" This will make kernel.img be u-boot image which will load uImage. By default, kernel.img is the actual kernel image (ex. Image). -2.K. Image with Initramfs +2.L. Image with Initramfs ========================= To build an initramfs image : * Set this 3 kernel variables (in linux-raspberrypi.inc for example)
@@ -176,7 +183,7 @@ To build an initramfs image : * Set the meta-rasberrypi variable (in raspberrypi.conf for example) - KERNEL_INITRAMFS = "-initramfs" -2.L. Device tree support +2.M. Device tree support ========================= Device tree for RPi is only supported when using linux-raspberrypi 3.18+ kernels.
@@ -189,11 +196,6 @@ kernels. NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for older kernel versions. -2.M. Optional - enable SPI bus -============================== -When using device tree kernels, set this variable to enable the SPI bus -ENABLE_SPI_BUS = "1" - 3. Extra apps =============
Signature · 1 line
1.9.1
Re: [meta-raspberrypi][PATCH v3 1/6] README: Add SPI bus chapter to content
Quoted 74 lines · Petter Mabäcker
The optional SPI bus chapter was missing in the content list.
While at it also place it together with the other "optional" chapters, instead of in the end.
Signed-off-by Petter Mabäcker <[email protected]>--- README | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)README +15
-8@@ -20,10 +20,11 @@ Contents: 2.F. Optional - Video camera support with V4L2 drivers 2.G. Optional - Enable offline compositing support 2.H. Optional - Enable kgdb over console support - 2.I. Images - 2.J. Boot to U-Boot - 2.K. Image with Initramfs - 2.L. Device tree support + 2.I. Optional - Enable SPI bus + 2.J. Images + 2.K. Boot to U-Boot + 2.L. Image with Initramfs + 2.M. Device tree support 3. Extra apps 3.A. omxplayer 4. Source code and mirrors@@ -145,7 +146,13 @@ To add the kdbg over console (kgdboc) parameter to the kernel command line, set this variable in local.conf: ENABLE_KGDB = "1" -2.I. Images +2.I. Optional - Enable SPI bus +============================== +When using device tree kernels, set this variable to enable the SPI bus +ENABLE_SPI_BUS = "1" + + +2.J. Images =========== * rpi-hwup-image Hardware up image@@ -155,7 +162,7 @@ ENABLE_KGDB = "1" Image based on rpi-basic-image which includes most of the packages in this layer and some media samples. -2.J. Boot to U-Boot +2.K. Boot to U-Boot =================== To have u-boot load kernel image, set in your local.conf KERNEL_IMAGETYPE = "uImage"@@ -163,7 +170,7 @@ KERNEL_IMAGETYPE = "uImage" This will make kernel.img be u-boot image which will load uImage. By default, kernel.img is the actual kernel image (ex. Image). -2.K. Image with Initramfs +2.L. Image with Initramfs ========================= To build an initramfs image : * Set this 3 kernel variables (in linux-raspberrypi.inc for example)@@ -176,7 +183,7 @@ To build an initramfs image : * Set the meta-rasberrypi variable (in raspberrypi.conf for example) - KERNEL_INITRAMFS = "-initramfs" -2.L. Device tree support +2.M. Device tree support ========================= Device tree for RPi is only supported when using linux-raspberrypi 3.18+ kernels.@@ -189,11 +196,6 @@ kernels. NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for
README kernels. · line 201
Quoted 10 lines
README +0
-5older kernel versions. -2.M. Optional - enable SPI bus -============================== -When using device tree kernels, set this variable to enable the SPI bus -ENABLE_SPI_BUS = "1" - 3. Extra apps =============
I restructured a little the readme and included a similar change. It is master. Thanks.
--
Andrei Gherzan
PATCH v3 2/6 .gitignore: Ignore .swp files
In reply to Petter Mabäcker--- .gitignore | 1 + 1 file changed, 1 insertion(+)
.gitignore +1 -0
@@ -1,2 +1,3 @@ build* *~ +.*.swp
Signature · 1 line
1.9.1
Andrei Gherzan
AppliedRe: [meta-raspberrypi][PATCH v3 2/6] .gitignore: Ignore .swp files
.gitignore line 3
Quoted 13 lines · Petter Mabäcker
Signed-off-by Petter Mabäcker <[email protected]>--- .gitignore | 1 + 1 file changed, 1 insertion(+).gitignore +1
-0@@ -1,2 +1,3 @@ build* *~ +.*.swp
Merged to master. Thanks.
--
Andrei Gherzan
PATCH v3 3/6 rpi-config: I2C support
In reply to Petter MabäckerWith newer kernels (>=3.18) that supports device-trees I2C should be enabled with device-trees.
This is now support by adding:ENABLE_I2C = "1"
in local.conf
This will enable the dtparams:
i2c1i2c_arm
--- README | 21 +++++++++++++-------- recipes-bsp/bootfiles/rpi-config_git.bb | 6 ++++++ 2 files changed, 19 insertions(+), 8 deletions(-)
README +13 -8
@@ -21,10 +21,11 @@ Contents: 2.G. Optional - Enable offline compositing support 2.H. Optional - Enable kgdb over console support 2.I. Optional - Enable SPI bus - 2.J. Images - 2.K. Boot to U-Boot - 2.L. Image with Initramfs - 2.M. Device tree support + 2.J. Optional - Enable I2C + 2.K. Images + 2.L. Boot to U-Boot + 2.M. Image with Initramfs + 2.N. Device tree support 3. Extra apps 3.A. omxplayer 4. Source code and mirrors
@@ -151,8 +152,12 @@ ENABLE_KGDB = "1" When using device tree kernels, set this variable to enable the SPI bus ENABLE_SPI_BUS = "1" +2.J. Optional - Enable I2C +========================== +When using device tree kernels, set this variable to enable I2C +ENABLE_I2C = "1" -2.J. Images +2.K. Images =========== * rpi-hwup-image Hardware up image
@@ -162,7 +167,7 @@ ENABLE_SPI_BUS = "1" Image based on rpi-basic-image which includes most of the packages in this layer and some media samples. -2.K. Boot to U-Boot +2.L. Boot to U-Boot =================== To have u-boot load kernel image, set in your local.conf KERNEL_IMAGETYPE = "uImage"
@@ -170,7 +175,7 @@ KERNEL_IMAGETYPE = "uImage" This will make kernel.img be u-boot image which will load uImage. By default, kernel.img is the actual kernel image (ex. Image). -2.L. Image with Initramfs +2.M. Image with Initramfs ========================= To build an initramfs image : * Set this 3 kernel variables (in linux-raspberrypi.inc for example)
@@ -183,7 +188,7 @@ To build an initramfs image : * Set the meta-rasberrypi variable (in raspberrypi.conf for example) - KERNEL_INITRAMFS = "-initramfs" -2.M. Device tree support +2.N. Device tree support ========================= Device tree for RPi is only supported when using linux-raspberrypi 3.18+ kernels.
recipes-bsp/bootfiles/rpi-config_git.bb +6 -0
@@ -72,6 +72,12 @@ do_deploy() { echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt fi + + if [ -n "${ENABLE_I2C}" ]; then + echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi } addtask deploy before do_package after do_install
Signature · 1 line
1.9.1
Re: [meta-raspberrypi][PATCH v3 3/6] rpi-config: I2C support
Hi Petter,
Quoted 10 lines · Petter Mabäcker
With newer kernels (>=3.18) that supports device-trees I2C should be enabled with device-trees.
This is now support by adding:
ENABLE_I2C= "1"
in local.confThis will enable the dtparams:
i2c1i2c_arm
Nice, this is exactly what I needed. Actually, yesterday I was searching how to enable I2C through local.conf on rpi. I hope your patch will be soon merged.
Thanks, Leon
Quoted 98 lines
Signed-off-by Petter Mabäcker <[email protected]>--- README | 21 +++++++++++++-------- recipes-bsp/bootfiles/rpi-config_git.bb | 6 ++++++ 2 files changed, 19 insertions(+), 8 deletions(-)README +5
-4@@ -21,10 +21,11 @@ Contents: 2.G. Optional - Enable offline compositing support 2.H. Optional - Enable kgdb over console support 2.I. Optional - Enable SPI bus - 2.J. Images - 2.K. Boot to U-Boot - 2.L. Image with Initramfs - 2.M. Device tree support + 2.J. Optional - Enable I2C + 2.K. Images + 2.L. Boot to U-Boot + 2.M. Image with Initramfs + 2.N. Device tree support 3. Extra apps 3.A. omxplayer 4. Source code and mirrors@@ -151,8 +152,12 @@ ENABLE_KGDB = "1" When using device tree kernels, set this variable to enable the SPIbus
ENABLE_SPI_BUS= "1"+2.J. Optional - Enable I2C
+==========================README +3
-1+When using device tree kernels, set this variable to enable I2C +ENABLE_I2C = "1" -2.J. Images +2.K. Images =========== * rpi-hwup-image Hardware up image@@ -162,7 +167,7 @@ ENABLE_SPI_BUS = "1" Image based on rpi-basic-image which includes most of the packagesin this
layer and some media samples.-2.K. Boot to U-Boot
+2.L. Boot to U-Boot
===================
To have u-boot load kernel image, set in your local.confKERNEL_IMAGETYPE= "uImage"README +1
-1@@ -170,7 +175,7 @@ KERNEL_IMAGETYPE = "uImage" This will make kernel.img be u-boot image which will load uImage. By default, kernel.img is the actual kernel image (ex. Image). -2.L. Image with Initramfs +2.M. Image with Initramfs ========================= To build an initramfs image : * Set this 3 kernel variables (in linux-raspberrypi.inc forexample)
README +1
-1@@ -183,7 +188,7 @@ To build an initramfs image : * Set the meta-rasberrypi variable (in raspberrypi.conf for example) - KERNEL_INITRAMFS = "-initramfs" -2.M. Device tree support +2.N. Device tree support ========================= Device tree for RPi is only supported when using linux-raspberrypi3.18+
kernels.recipes-bsp/bootfiles/rpi-config_git.bb +0
-0@@ -72,6 +72,12 @@ do_deploy() { echo "# Enable SPI bus"Quoted 1 line
Quoted 1 line
${DEPLOYDIR}/bcm2835-bootfiles/config.txtecho "dtparam=spi=on"
Quoted 1 line
Quoted 1 line
${DEPLOYDIR}/bcm2835-bootfiles/config.txtfi
recipes-bsp/bootfiles/rpi-config_git.bb +3
-0+ + if [ -n "${ENABLE_I2C}" ]; then + echo "# Enable I2C"Quoted 1 line
Quoted 1 line
${DEPLOYDIR}/bcm2835-bootfiles/config.txt+ echo "dtparam=i2c1=on"
Quoted 1 line
Quoted 1 line
${DEPLOYDIR}/bcm2835-bootfiles/config.txt+ echo "dtparam=i2c_arm=on"
Quoted 1 line
Quoted 1 line
${DEPLOYDIR}/bcm2835-bootfiles/config.txt+ fi
}addtask deploy before
do_packageafterdo_install
--
1.9.1
Signature · 1 line
http://anavi.org/
Re: [meta-raspberrypi][PATCH v3 3/6] rpi-config: I2C support
In reply to Petter MabäckerQuoted 85 lines · Petter Mabäcker
With newer kernels (>=3.18) that supports device-trees I2C should be enabled with device-trees.
This is now support by adding:
ENABLE_I2C= "1"
in local.confThis will enable the dtparams:
i2c1i2c_armSigned-off-by Petter Mabäcker <[email protected]>--- README | 21 +++++++++++++-------- recipes-bsp/bootfiles/rpi-config_git.bb | 6 ++++++ 2 files changed, 19 insertions(+), 8 deletions(-)README +13
-8@@ -21,10 +21,11 @@ Contents: 2.G. Optional - Enable offline compositing support 2.H. Optional - Enable kgdb over console support 2.I. Optional - Enable SPI bus - 2.J. Images - 2.K. Boot to U-Boot - 2.L. Image with Initramfs - 2.M. Device tree support + 2.J. Optional - Enable I2C + 2.K. Images + 2.L. Boot to U-Boot + 2.M. Image with Initramfs + 2.N. Device tree support 3. Extra apps 3.A. omxplayer 4. Source code and mirrors@@ -151,8 +152,12 @@ ENABLE_KGDB = "1" When using device tree kernels, set this variable to enable the SPI bus ENABLE_SPI_BUS = "1" +2.J. Optional - Enable I2C +========================== +When using device tree kernels, set this variable to enable I2C +ENABLE_I2C = "1" -2.J. Images +2.K. Images =========== * rpi-hwup-image Hardware up image@@ -162,7 +167,7 @@ ENABLE_SPI_BUS = "1" Image based on rpi-basic-image which includes most of the packages in this layer and some media samples. -2.K. Boot to U-Boot +2.L. Boot to U-Boot =================== To have u-boot load kernel image, set in your local.conf KERNEL_IMAGETYPE = "uImage"@@ -170,7 +175,7 @@ KERNEL_IMAGETYPE = "uImage" This will make kernel.img be u-boot image which will load uImage. By default, kernel.img is the actual kernel image (ex. Image). -2.L. Image with Initramfs +2.M. Image with Initramfs ========================= To build an initramfs image : * Set this 3 kernel variables (in linux-raspberrypi.inc for example)@@ -183,7 +188,7 @@ To build an initramfs image : * Set the meta-rasberrypi variable (in raspberrypi.conf for example) - KERNEL_INITRAMFS = "-initramfs" -2.M. Device tree support +2.N. Device tree support ========================= Device tree for RPi is only supported when using linux-raspberrypi 3.18+ kernels.recipes-bsp/bootfiles/rpi-config_git.bb +0
-0@@ -72,6 +72,12 @@ do_deploy() { echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
recipes-bsp/bootfiles/rpi-config_git.bb do_deploy() { · line 83
Quoted 10 lines
recipes-bsp/bootfiles/rpi-config_git.bb +6
-0fi + + if [ -n "${ENABLE_I2C}" ]; then + echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi } addtask deploy before do_package after do_install
I rebased this on current master and merged to master. Thanks.
--
Andrei Gherzan
PATCH v3 4/6 rpi-base.inc: Allow MACHINE_FEATURES appends
In reply to Petter MabäckerEnsure that it's possible to add MACHINE_FEATURES from places that will be executed before rpi-base.inc (like e.g. local.conf), without having them overrided.
--- conf/machine/include/rpi-base.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
conf/machine/include/rpi-base.inc +1 -1
@@ -37,7 +37,7 @@ KERNEL_DEVICETREE ?= " \ " KERNEL_IMAGETYPE ?= "Image" -MACHINE_FEATURES = "kernel26 apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio" +MACHINE_FEATURES += "kernel26 apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio" # Raspberry Pi has no hardware clock MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
Signature · 1 line
1.9.1
Andrei Gherzan
AppliedRe: [meta-raspberrypi][PATCH v3 4/6] rpi-base.inc: Allow MACHINE_FEATURES appends
Quoted 14 lines · Petter Mabäcker
Ensure that it's possible to add
MACHINE_FEATURESfrom places that will be executed before rpi-base.inc (like e.g. local.conf), without having them overrided.Signed-off-by Petter Mabäcker <[email protected]>--- conf/machine/include/rpi-base.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)conf/machine/include/rpi-base.inc +0
-0
conf/machine/include/rpi-base.inc KERNEL_DEVICETREE ?= " \ · line 43
Quoted 8 lines
conf/machine/include/rpi-base.inc +1
-1@@ -37,7 +37,7 @@ KERNEL_DEVICETREE ?= " \ " KERNEL_IMAGETYPE ?= "Image" -MACHINE_FEATURES = "kernel26 apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio" +MACHINE_FEATURES += "kernel26 apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio" # Raspberry Pi has no hardware clock MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
Merged to master. Thanks.
--
Andrei Gherzan
PATCH v3 5/6 pitft: Add basic support for PiTFT
In reply to Petter MabäckerAdd basic support for PiTFT display by using device-trees.
In order get it working below configurations must be active in local.conf:
MACHINE_FEATURES += "pitft"
- This will enable SPI bus and i2c device-trees, it will also setup framebuffer for console and x server on PiTFT.
[Support #70]
--- README | 29 ++++++++++++++++------ recipes-bsp/bootfiles/rpi-config_git.bb | 6 +++-- .../rpi/xorg.conf.d/99-pitft.conf | 5 ++++ .../xorg-xserver/xserver-xf86-config_0.1.bbappend | 11 ++++++-- recipes-kernel/linux/linux-raspberrypi.inc | 6 ++++- 5 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-pitft.conf
README +21 -8
@@ -22,10 +22,11 @@ Contents: 2.H. Optional - Enable kgdb over console support 2.I. Optional - Enable SPI bus 2.J. Optional - Enable I2C - 2.K. Images - 2.L. Boot to U-Boot - 2.M. Image with Initramfs - 2.N. Device tree support + 2.K. Optional - Enable PiTFT support + 2.L. Images + 2.M. Boot to U-Boot + 2.N. Image with Initramfs + 2.O. Device tree support 3. Extra apps 3.A. omxplayer 4. Source code and mirrors
@@ -157,7 +158,19 @@ ENABLE_SPI_BUS = "1" When using device tree kernels, set this variable to enable I2C ENABLE_I2C = "1" -2.K. Images +2.K. Optional - Enable PiTFT support +==================================== +Basic support for using PiTFT screens can be enabled by adding +below in local.conf: + +MACHINE_FEATURES += "pitft" + - This will enable SPI bus and i2c device-trees, it will also setup + framebuffer for console and x server on PiTFT. + +NOTE: To get this working the overlay for the PiTFT model must be build, + added and specified as well (dtoverlay=<driver> in config.txt) + +2.L. Images =========== * rpi-hwup-image Hardware up image
@@ -167,7 +180,7 @@ ENABLE_I2C = "1" Image based on rpi-basic-image which includes most of the packages in this layer and some media samples. -2.L. Boot to U-Boot +2.M. Boot to U-Boot =================== To have u-boot load kernel image, set in your local.conf KERNEL_IMAGETYPE = "uImage"
@@ -175,7 +188,7 @@ KERNEL_IMAGETYPE = "uImage" This will make kernel.img be u-boot image which will load uImage. By default, kernel.img is the actual kernel image (ex. Image). -2.M. Image with Initramfs +2.N. Image with Initramfs ========================= To build an initramfs image : * Set this 3 kernel variables (in linux-raspberrypi.inc for example)
@@ -188,7 +201,7 @@ To build an initramfs image : * Set the meta-rasberrypi variable (in raspberrypi.conf for example) - KERNEL_INITRAMFS = "-initramfs" -2.N. Device tree support +2.O. Device tree support ========================= Device tree for RPi is only supported when using linux-raspberrypi 3.18+ kernels.
recipes-bsp/bootfiles/rpi-config_git.bb +4 -2
@@ -15,6 +15,8 @@ S = "${WORKDIR}/git" PR = "r4" +PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" + inherit deploy do_deploy() {
@@ -68,12 +70,12 @@ do_deploy() { fi # SPI bus support - if [ -n "${ENABLE_SPI_BUS}" ]; then + if [ -n "${ENABLE_SPI_BUS}" ] || [ "${PITFT}" = "1" ]; then echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt fi - if [ -n "${ENABLE_I2C}" ]; then + if [ -n "${ENABLE_I2C}" ] || [ "${PITFT}" = "1" ]; then echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-pitft.conf new file +5 -0
@@ -0,0 +1,5 @@ +Section "Device" + Identifier "Adafruit PiTFT" + Driver "fbdev" + Option "fbdev" "/dev/fb1" +EndSection
recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend +9 -2
@@ -1,10 +1,17 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI_append_rpi = " file://xorg.conf.d/10-evdev.conf " +SRC_URI_append_rpi = " file://xorg.conf.d/10-evdev.conf \ + file://xorg.conf.d/99-pitft.conf \ + " do_install_append_rpi () { install -d ${D}/${sysconfdir}/X11/xorg.conf.d/ - install -m 0644 ${WORKDIR}/xorg.conf.d/* ${D}/${sysconfdir}/X11/xorg.conf.d/ + install -m 0644 ${WORKDIR}/xorg.conf.d/10-evdev.conf ${D}/${sysconfdir}/X11/xorg.conf.d/ + + PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" + if [ "${PITFT}" = "1" ]; then + install -m 0644 ${WORKDIR}/xorg.conf.d/99-pitft.conf ${D}/${sysconfdir}/X11/xorg.conf.d/ + fi } FILES_${PN}_rpi += "${sysconfdir}/X11/xorg.conf ${sysconfdir}/X11/xorg.conf.d/*"
recipes-kernel/linux/linux-raspberrypi.inc +5 -1
@@ -53,7 +53,11 @@ do_install_prepend() { do_deploy_append() { # Deploy cmdline.txt install -d ${DEPLOYDIR}/bcm2835-bootfiles - echo "${CMDLINE}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt + PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" + if [ ${PITFT} = "1" ]; then + PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8" + fi + echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt } do_rpiboot_mkimage() {
Signature · 1 line
1.9.1
Andrei Gherzan
AppliedRe: [meta-raspberrypi][PATCH v3 5/6] pitft: Add basic support for PiTFT
Quoted 159 lines · Petter Mabäcker
Add basic support for PiTFT display by using device-trees.
In order get it working below configurations must be active in local.conf:
MACHINE_FEATURES+= "pitft"
- This will enable SPI bus and i2c device-trees, it will also setup framebuffer for console and x server on PiTFT.[Support #70]
Signed-off-by Petter Mabäcker <[email protected]>--- README | 29 ++++++++++++++++------ recipes-bsp/bootfiles/rpi-config_git.bb | 6 +++-- .../rpi/xorg.conf.d/99-pitft.conf | 5 ++++ .../xorg-xserver/xserver-xf86-config_0.1.bbappend | 11 ++++++-- recipes-kernel/linux/linux-raspberrypi.inc | 6 ++++- 5 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-pitft.confREADME +21
-8@@ -22,10 +22,11 @@ Contents: 2.H. Optional - Enable kgdb over console support 2.I. Optional - Enable SPI bus 2.J. Optional - Enable I2C - 2.K. Images - 2.L. Boot to U-Boot - 2.M. Image with Initramfs - 2.N. Device tree support + 2.K. Optional - Enable PiTFT support + 2.L. Images + 2.M. Boot to U-Boot + 2.N. Image with Initramfs + 2.O. Device tree support 3. Extra apps 3.A. omxplayer 4. Source code and mirrors@@ -157,7 +158,19 @@ ENABLE_SPI_BUS = "1" When using device tree kernels, set this variable to enable I2C ENABLE_I2C = "1" -2.K. Images +2.K. Optional - Enable PiTFT support +==================================== +Basic support for using PiTFT screens can be enabled by adding +below in local.conf: + +MACHINE_FEATURES += "pitft" + - This will enable SPI bus and i2c device-trees, it will also setup + framebuffer for console and x server on PiTFT. + +NOTE: To get this working the overlay for the PiTFT model must be build, + added and specified as well (dtoverlay=<driver> in config.txt) + +2.L. Images =========== * rpi-hwup-image Hardware up image@@ -167,7 +180,7 @@ ENABLE_I2C = "1" Image based on rpi-basic-image which includes most of the packages in this layer and some media samples. -2.L. Boot to U-Boot +2.M. Boot to U-Boot =================== To have u-boot load kernel image, set in your local.conf KERNEL_IMAGETYPE = "uImage"@@ -175,7 +188,7 @@ KERNEL_IMAGETYPE = "uImage" This will make kernel.img be u-boot image which will load uImage. By default, kernel.img is the actual kernel image (ex. Image). -2.M. Image with Initramfs +2.N. Image with Initramfs ========================= To build an initramfs image : * Set this 3 kernel variables (in linux-raspberrypi.inc for example)@@ -188,7 +201,7 @@ To build an initramfs image : * Set the meta-rasberrypi variable (in raspberrypi.conf for example) - KERNEL_INITRAMFS = "-initramfs" -2.N. Device tree support +2.O. Device tree support ========================= Device tree for RPi is only supported when using linux-raspberrypi 3.18+ kernels.recipes-bsp/bootfiles/rpi-config_git.bb +4
-2@@ -15,6 +15,8 @@ S = "${WORKDIR}/git" PR = "r4" +PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" + inherit deploy do_deploy() {@@ -68,12 +70,12 @@ do_deploy() { fi # SPI bus support - if [ -n "${ENABLE_SPI_BUS}" ]; then + if [ -n "${ENABLE_SPI_BUS}" ] || [ "${PITFT}" = "1" ]; then echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt fi - if [ -n "${ENABLE_I2C}" ]; then + if [ -n "${ENABLE_I2C}" ] || [ "${PITFT}" = "1" ]; then echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txtrecipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-pitft.conf new file +5
-0@@ -0,0 +1,5 @@ +Section "Device" + Identifier "Adafruit PiTFT" + Driver "fbdev" + Option "fbdev" "/dev/fb1" +EndSectionrecipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend +9
-2@@ -1,10 +1,17 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI_append_rpi = " file://xorg.conf.d/10-evdev.conf " +SRC_URI_append_rpi = " file://xorg.conf.d/10-evdev.conf \ + file://xorg.conf.d/99-pitft.conf \ + " do_install_append_rpi () { install -d ${D}/${sysconfdir}/X11/xorg.conf.d/ - install -m 0644 ${WORKDIR}/xorg.conf.d/* ${D}/${sysconfdir}/X11/xorg.conf.d/ + install -m 0644 ${WORKDIR}/xorg.conf.d/10-evdev.conf ${D}/${sysconfdir}/X11/xorg.conf.d/ + + PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" + if [ "${PITFT}" = "1" ]; then + install -m 0644 ${WORKDIR}/xorg.conf.d/99-pitft.conf ${D}/${sysconfdir}/X11/xorg.conf.d/ + fi } FILES_${PN}_rpi += "${sysconfdir}/X11/xorg.conf ${sysconfdir}/X11/xorg.conf.d/*"recipes-kernel/linux/linux-raspberrypi.inc +0
-0@@ -53,7 +53,11 @@ do_install_prepend() { do_deploy_append() { # Deploy cmdline.txt
recipes-kernel/linux/linux-raspberrypi.inc do_install_prepend() { · line 63
Quoted 10 lines
recipes-kernel/linux/linux-raspberrypi.inc +5
-1install -d ${DEPLOYDIR}/bcm2835-bootfiles - echo "${CMDLINE}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt + PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" + if [ ${PITFT} = "1" ]; then + PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8" + fi + echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt } do_rpiboot_mkimage() {
Merged to master.
--
Andrei Gherzan
PATCH v3 6/6 pitft: Add PiTFT22 support
In reply to Petter Mabäcker- Add support to build overlays for PiTFT22 in the kernel.
- Setup a basic configuration for the driver
The PiTFT22 support is optional and can be enabled by adding below in local.conf:
MACHINE_FEATURES += "pitft pitft22"
[Support #70]
--- README | 9 ++ conf/machine/include/rpi-base.inc | 1 + recipes-bsp/bootfiles/rpi-config_git.bb | 7 ++ ...dts-add-overlay-for-pitft22-in-linux-3.18.patch | 110 +++++++++++++++++++++ .../0001-dts-add-overlay-for-pitft22.patch | 110 +++++++++++++++++++++ recipes-kernel/linux/linux-raspberrypi_3.18.bb | 5 +- recipes-kernel/linux/linux-raspberrypi_4.1.bb | 4 +- 7 files changed, 243 insertions(+), 3 deletions(-) create mode 100644 recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch create mode 100644 recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22.patch
README +9 -0
@@ -170,6 +170,15 @@ MACHINE_FEATURES += "pitft" NOTE: To get this working the overlay for the PiTFT model must be build, added and specified as well (dtoverlay=<driver> in config.txt) +Below is a list of currently supported PiTFT models in meta-raspberrypi, +the modelname should be added as a MACHINE_FEATURES in local.conf like below: + + - MACHINE_FEATURES += "pitft <modelname>" + +List of currently supported models +----------------------------------- +pitft22 + 2.L. Images =========== * rpi-hwup-image
conf/machine/include/rpi-base.inc +1 -0
@@ -31,6 +31,7 @@ KERNEL_DEVICETREE ?= " \ overlays/iqaudio-dac-overlay.dtb \ overlays/iqaudio-dacplus-overlay.dtb \ overlays/lirc-rpi-overlay.dtb \ + overlays/pitft22-overlay.dtb \ overlays/pps-gpio-overlay.dtb \ overlays/w1-gpio-overlay.dtb \ overlays/w1-gpio-pullup-overlay.dtb \
recipes-bsp/bootfiles/rpi-config_git.bb +7 -0
@@ -16,6 +16,7 @@ S = "${WORKDIR}/git" PR = "r4" PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" +PITFT22="${@bb.utils.contains("MACHINE_FEATURES", "pitft22", "1", "0", d)}" inherit deploy
@@ -80,6 +81,12 @@ do_deploy() { echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt fi + + # PiTFT22 display support + if [ "${PITFT22}" = "1" ]; then + echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi } addtask deploy before do_package after do_install
recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch new file +110 -0
110 lines not on this page · raw message
recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22.patch new file +110 -0
110 lines not on this page · raw message
recipes-kernel/linux/linux-raspberrypi_3.18.bb +3 -2
@@ -1,8 +1,9 @@ LINUX_VERSION ?= "3.18.16" SRCREV = "1bb18c8f721ef674a447f3622273f2e2de7a205c" -SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-3.18.y" - +SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-3.18.y \ + file://0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch \ + " require linux-raspberrypi.inc # Create missing out of tree 'overlays' directory prior to install step
recipes-kernel/linux/linux-raspberrypi_4.1.bb +3 -1
@@ -1,6 +1,8 @@ LINUX_VERSION ?= "4.1.10" SRCREV = "b74df9228c27f55361c065bc5dbfba88861cc771" -SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.1.y" +SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.1.y \ + file://0001-dts-add-overlay-for-pitft22.patch \ + " require linux-raspberrypi.inc
Signature · 1 line
1.9.1
Re: [meta-raspberrypi][PATCH v3 6/6] pitft: Add PiTFT22 support
Quoted 333 lines · Petter Mabäcker
- Add support to build overlays for PiTFT22 in the kernel.
- Setup a basic configuration for the driverThe PiTFT22 support is optional and can be enabled by adding below in local.conf:
MACHINE_FEATURES+= "pitft pitft22"[Support #70]
Signed-off-by Petter Mabäcker <[email protected]>--- README | 9 ++ conf/machine/include/rpi-base.inc | 1 + recipes-bsp/bootfiles/rpi-config_git.bb | 7 ++ ...dts-add-overlay-for-pitft22-in-linux-3.18.patch | 110 +++++++++++++++++++++ .../0001-dts-add-overlay-for-pitft22.patch | 110 +++++++++++++++++++++ recipes-kernel/linux/linux-raspberrypi_3.18.bb | 5 +- recipes-kernel/linux/linux-raspberrypi_4.1.bb | 4 +- 7 files changed, 243 insertions(+), 3 deletions(-) create mode 100644 recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch create mode 100644 recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22.patchREADME +9
-0@@ -170,6 +170,15 @@ MACHINE_FEATURES += "pitft" NOTE: To get this working the overlay for the PiTFT model must be build, added and specified as well (dtoverlay=<driver> in config.txt) +Below is a list of currently supported PiTFT models in meta-raspberrypi, +the modelname should be added as a MACHINE_FEATURES in local.conf like below: + + - MACHINE_FEATURES += "pitft <modelname>" + +List of currently supported models +----------------------------------- +pitft22 + 2.L. Images =========== * rpi-hwup-imageconf/machine/include/rpi-base.inc +1
-0@@ -31,6 +31,7 @@ KERNEL_DEVICETREE ?= " \ overlays/iqaudio-dac-overlay.dtb \ overlays/iqaudio-dacplus-overlay.dtb \ overlays/lirc-rpi-overlay.dtb \ + overlays/pitft22-overlay.dtb \ overlays/pps-gpio-overlay.dtb \ overlays/w1-gpio-overlay.dtb \ overlays/w1-gpio-pullup-overlay.dtb \recipes-bsp/bootfiles/rpi-config_git.bb +7
-0@@ -16,6 +16,7 @@ S = "${WORKDIR}/git" PR = "r4" PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" +PITFT22="${@bb.utils.contains("MACHINE_FEATURES", "pitft22", "1", "0", d)}" inherit deploy@@ -80,6 +81,12 @@ do_deploy() { echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt fi + + # PiTFT22 display support + if [ "${PITFT22}" = "1" ]; then + echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi } addtask deploy before do_package after do_installrecipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch new file +110
-0@@ -0,0 +1,110 @@ +From 2f44861e2a2d651a9aa62a75343a032fee33e93b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petter=20Mab=C3=A4cker?= <[email protected]> +Date: Fri, 8 Jan 2016 09:02:44 +0100 +Subject: [PATCH] dts: add overlay for pitft22 in linux 3.18 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Pending + +Add the pitft22 overlay from adafruit Adafruit-Pi-Kernel-o-Matic repo: +https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic + +Signed-off-by: Petter Mabäcker <[email protected]> +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/pitft22-overlay.dts | 69 ++++++++++++++++++++++++++ + 2 files changed, 70 insertions(+) + create mode 100755 arch/arm/boot/dts/overlays/pitft22-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index c766616..1eaaf81 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -27,6 +27,7 @@ dtb-$(RPI_DT_OVERLAYS) += mcp2515-can0-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += pitft22-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += rpi-dac-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/pitft22-overlay.dts b/arch/arm/boot/dts/overlays/pitft22-overlay.dts +new file mode 100755 +index 0000000..894ba22 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/pitft22-overlay.dts +@@ -0,0 +1,69 @@ ++/* ++ * Device Tree overlay for pitft by Adafruit ++ * ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target = <&spi0>; ++ __overlay__ { ++ status = "okay"; ++ ++ spidev@0{ ++ status = "disabled"; ++ }; ++ ++ spidev@1{ ++ status = "disabled"; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ pitft_pins: pitft_pins { ++ brcm,pins = <25>; ++ brcm,function = <1>; /* out */ ++ brcm,pull = <0>; /* none */ ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&spi0>; ++ __overlay__ { ++ /* needed to avoid dtc warning */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ pitft: pitft@0{ ++ compatible = "ilitek,ili9340"; ++ reg = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pitft_pins>; ++ ++ spi-max-frequency = <32000000>; ++ rotate = <90>; ++ fps = <25>; ++ bgr; ++ buswidth = <8>; ++ dc-gpios = <&gpio 25 0>; ++ debug = <0>; ++ }; ++ ++ }; ++ }; ++ ++ __overrides__ { ++ speed = <&pitft>,"spi-max-frequency:0"; ++ rotate = <&pitft>,"rotate:0"; ++ fps = <&pitft>,"fps:0"; ++ debug = <&pitft>,"debug:0"; ++ }; ++}; +-- +1.9.1 +recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22.patch new file +110
-0@@ -0,0 +1,110 @@ +From a28bd410022b32a64e208f04b45add6326990332 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petter=20Mab=C3=A4cker?= <[email protected]> +Date: Fri, 8 Jan 2016 09:02:44 +0100 +Subject: [PATCH] dts: add overlay for pitft22 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Pending + +Add the pitft22 overlay from adafruit Adafruit-Pi-Kernel-o-Matic repo: +https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic + +Signed-off-by: Petter Mabäcker <[email protected]> +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/pitft22-overlay.dts | 69 ++++++++++++++++++++++++++ + 2 files changed, 70 insertions(+) + create mode 100755 arch/arm/boot/dts/overlays/pitft22-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 1a60e9c..a2535a2 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -37,6 +37,7 @@ dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += piscreen2r-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += pitft22-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pitft28-capacitive-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/pitft22-overlay.dts b/arch/arm/boot/dts/overlays/pitft22-overlay.dts +new file mode 100755 +index 0000000..894ba22 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/pitft22-overlay.dts +@@ -0,0 +1,69 @@ ++/* ++ * Device Tree overlay for pitft by Adafruit ++ * ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target = <&spi0>; ++ __overlay__ { ++ status = "okay"; ++ ++ spidev@0{ ++ status = "disabled"; ++ }; ++ ++ spidev@1{ ++ status = "disabled"; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ pitft_pins: pitft_pins { ++ brcm,pins = <25>; ++ brcm,function = <1>; /* out */ ++ brcm,pull = <0>; /* none */ ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&spi0>; ++ __overlay__ { ++ /* needed to avoid dtc warning */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ pitft: pitft@0{ ++ compatible = "ilitek,ili9340"; ++ reg = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pitft_pins>; ++ ++ spi-max-frequency = <32000000>; ++ rotate = <90>; ++ fps = <25>; ++ bgr; ++ buswidth = <8>; ++ dc-gpios = <&gpio 25 0>; ++ debug = <0>; ++ }; ++ ++ }; ++ }; ++ ++ __overrides__ { ++ speed = <&pitft>,"spi-max-frequency:0"; ++ rotate = <&pitft>,"rotate:0"; ++ fps = <&pitft>,"fps:0"; ++ debug = <&pitft>,"debug:0"; ++ }; ++}; +-- +1.9.1 +recipes-kernel/linux/linux-raspberrypi_3.18.bb +3
-2@@ -1,8 +1,9 @@ LINUX_VERSION ?= "3.18.16" SRCREV = "1bb18c8f721ef674a447f3622273f2e2de7a205c" -SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-3.18.y" - +SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-3.18.y \ + file://0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch \ + " require linux-raspberrypi.inc # Create missing out of tree 'overlays' directory prior to install steprecipes-kernel/linux/linux-raspberrypi_4.1.bb +0
-0
recipes-kernel/linux/linux-raspberrypi_4.1.bb line 8
Quoted 9 lines
recipes-kernel/linux/linux-raspberrypi_4.1.bb +3
-1@@ -1,6 +1,8 @@ LINUX_VERSION ?= "4.1.10" SRCREV = "b74df9228c27f55361c065bc5dbfba88861cc771" -SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.1.y" +SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.1.y \ + file://0001-dts-add-overlay-for-pitft22.patch \ + " require linux-raspberrypi.inc
Cheers Peter!
Based on this patch I pushed a v4:
- resolve conflicts
- use patches specific for a certain kernel version in separate directories - easier to visualize
What do you think?
--
Andrei Gherzan
Re: [meta-raspberrypi][PATCH v3 6/6] pitft: Add PiTFT22 support
2016-03-02 00:50 skrev Andrei Gherzan:
Quoted 1 line
On Sun, Feb 28, 2016 at
Quoted 2 lines · Petter Mabäcker
Quoted 2 lines
- Add support to build
overlays for PiTFT22 in the kernel. - Setup a basic configuration for the driver The PiTFT22 support is optional and can be enabled by adding below in local.conf: MACHINE_FEATURES += "pitft pitft22" [Support #70]
conf/machine/include/rpi-base.inc | 1 + recipes-bsp/bootfiles/rpi-config_git.bb | 7 ++ ...dts-add-overlay-for-pitft22-in-linux-3.18.patch | 110 +++++++++++++++++++++ .../0001-dts-add-overlay-for-pitft22.patch | 110 +++++++++++++++++++++ recipes-kernel/linux/linux-raspberrypi_3.18.bb | 5
+- recipes-kernel/linux/linux-raspberrypi_4.1.bb | 4 +- 7 files changed,
243 insertions(+), 3 deletions(-) create mode 100644 recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch create mode 100644 recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22.patch
README index 6a6c398..4114ccc 100644 --- a/README renamed from README +0 -0
+++ b/README @@ -170,6 +170,15 @@ MACHINE_FEATURES += "pitft" NOTE: To get this working the overlay for the PiTFT model must be build, added and specified as well (dtoverlay=<driver> in config.txt) +Below is a list of currently supported PiTFT models in meta-raspberrypi, +the modelname should be added as a MACHINE_FEATURES in local.conf like
below: + + - MACHINE_FEATURES += "pitft <modelname>" + +List of currently supported models +----------------------------------- +pitft22
+ 2.L. Images =========== * rpi-hwup-image diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc index c8f6cd6..27f09ad 100644 --- a/conf/machine/include/rpi-base.inc +++ b/conf/machine/include/rpi-base.inc @@ -31,6 +31,7 @@ KERNEL_DEVICETREE ?= " overlays/iqaudio-dac-overlay.dtb overlays/iqaudio-dacplus-overlay.dtb overlays/lirc-rpi-overlay.dtb + overlays/pitft22-overlay.dtb overlays/pps-gpio-overlay.dtb overlays/w1-gpio-overlay.dtb overlays/w1-gpio-pullup-overlay.dtb diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb index 236a359..631ff42 100644 --- a/recipes-bsp/bootfiles/rpi-config_git.bb +++ b/recipes-bsp/bootfiles/rpi-config_git.bb @@ -16,6 +16,7 @@ S = "${WORKDIR}/git" PR = "r4" PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" +PITFT22="${@bb.utils.contains("MACHINE_FEATURES", "pitft22", "1", "0", d)}" inherit deploy @@ -80,6 +81,12 @@ do_deploy() { echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt fi + + # PiTFT22 display support + if [ "${PITFT22}" = "1" ]; then + echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768"
Quoted 1 line
Quoted 1 line
${DEPLOYDIR}/bcm2835-bootfiles/config.txt+ fi } addtask deploy before
do_package after do_install diff --git a/recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch b/recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch new file mode 100644 index 0000000..fa73599 --- /dev/null +++ b/recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch @@ -0,0 +1,110 @@ +From 2f44861e2a2d651a9aa62a75343a032fee33e93b Mon
Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petter=20Mab=C3=A4cker?=
<[email protected]> +Date: Fri, 8 Jan 2016 09:02:44 +0100 +Subject:
[PATCH] dts: add overlay for pitft22 in linux 3.18 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding:
8bit + +Upstream-Status: Pending + +Add the pitft22 overlay from adafruit Adafruit-Pi-Kernel-o-Matic repo:
+https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic [1] + +Signed-off-by: Petter Mabäcker <[email protected]> +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/pitft22-overlay.dts | 69 ++++++++++++++++++++++++++ + 2 files changed, 70 insertions(+) + create mode 100755 arch/arm/boot/dts/overlays/pitft22-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index c766616..1eaaf81 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -27,6 +27,7 @@ dtb-$(RPI_DT_OVERLAYS) += mcp2515-can0-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += pitft22-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += rpi-dac-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/pitft22-overlay.dts b/arch/arm/boot/dts/overlays/pitft22-overlay.dts +new file mode 100755 +index 0000000..894ba22 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/pitft22-overlay.dts +@@ -0,0 +1,69 @@ ++/* ++ * Device Tree overlay for pitft by Adafruit ++ * ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target = <&spi0>; ++ __overlay__ { ++ status = "okay"; ++ ++ spidev@0{ ++ status = "disabled"; ++ }; ++ ++ spidev@1{ ++ status = "disabled"; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ pitft_pins: pitft_pins { ++ brcm,pins = <25>; ++ brcm,function = <1>; /* out */ ++ brcm,pull = <0>; /* none */ ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&spi0>; ++ __overlay__ { ++ /* needed to avoid dtc warning */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ pitft: pitft@0{ ++ compatible = "ilitek,ili9340"; ++ reg = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pitft_pins>; ++ ++ spi-max-frequency = <32000000>; ++ rotate = <90>; ++ fps = <25>; ++ bgr; ++ buswidth = <8>; ++ dc-gpios = <&gpio 25 0>; ++ debug = <0>; ++ }; ++ ++ }; ++ }; ++ ++ __overrides__ { ++ speed = <&pitft>,"spi-max-frequency:0"; ++ rotate = <&pitft>,"rotate:0"; ++ fps = <&pitft>,"fps:0"; ++ debug = <&pitft>,"debug:0"; ++ }; ++}; +-- +1.9.1 + diff --git a/recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22.patch b/recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22.patch new file mode 100644 index 0000000..e6e0a84 --- /dev/null +++ b/recipes-kernel/linux/linux-raspberrypi/0001-dts-add-overlay-for-pitft22.patch @@ -0,0 +1,110 @@ +From a28bd410022b32a64e208f04b45add6326990332 Mon
Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petter=20Mab=C3=A4cker?=
<[email protected]> +Date: Fri, 8 Jan 2016 09:02:44 +0100 +Subject:
[PATCH] dts: add overlay for pitft22 +MIME-Version: 1.0 +Content-Type:
text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Pending + +Add the pitft22 overlay from adafruit Adafruit-Pi-Kernel-o-Matic repo:
+https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic [1] + +Signed-off-by: Petter Mabäcker <[email protected]> +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/pitft22-overlay.dts | 69 ++++++++++++++++++++++++++ + 2 files changed, 70 insertions(+) + create mode 100755 arch/arm/boot/dts/overlays/pitft22-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 1a60e9c..a2535a2 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -37,6 +37,7 @@ dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += piscreen2r-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += pitft22-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pitft28-capacitive-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/pitft22-overlay.dts b/arch/arm/boot/dts/overlays/pitft22-overlay.dts +new file mode 100755 +index 0000000..894ba22 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/pitft22-overlay.dts +@@ -0,0 +1,69 @@ ++/* ++ * Device Tree overlay for pitft by Adafruit ++ * ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target = <&spi0>; ++ __overlay__ { ++ status = "okay"; ++ ++ spidev@0{ ++ status = "disabled"; ++ }; ++ ++ spidev@1{ ++ status = "disabled"; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ pitft_pins: pitft_pins { ++ brcm,pins = <25>; ++ brcm,function = <1>; /* out */ ++ brcm,pull = <0>; /* none */ ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&spi0>; ++ __overlay__ { ++ /* needed to avoid dtc warning */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ pitft: pitft@0{ ++ compatible = "ilitek,ili9340"; ++ reg = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pitft_pins>; ++ ++ spi-max-frequency = <32000000>; ++ rotate = <90>; ++ fps = <25>; ++ bgr; ++ buswidth = <8>; ++ dc-gpios = <&gpio 25 0>; ++ debug = <0>; ++ }; ++ ++ }; ++ }; ++ ++ __overrides__ { ++ speed = <&pitft>,"spi-max-frequency:0"; ++ rotate = <&pitft>,"rotate:0"; ++ fps = <&pitft>,"fps:0"; ++ debug = <&pitft>,"debug:0"; ++ }; ++}; +-- +1.9.1 + diff --git a/recipes-kernel/linux/linux-raspberrypi_3.18.bb b/recipes-kernel/linux/linux-raspberrypi_3.18.bb index a1fe6b4..9234f70 100644 --- a/recipes-kernel/linux/linux-raspberrypi_3.18.bb +++ b/recipes-kernel/linux/linux-raspberrypi_3.18.bb @@ -1,8 +1,9 @@ LINUX_VERSION ?= "3.18.16" SRCREV = "1bb18c8f721ef674a447f3622273f2e2de7a205c" -SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-3.18.y"
- +SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-3.18.y + file://0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch [2] + " require linux-raspberrypi.inc # Create missing out of tree 'overlays' directory prior to install step diff --git a/recipes-kernel/linux/linux-raspberrypi_4.1.bb b/recipes-kernel/linux/linux-raspberrypi_4.1.bb index 3a3cf40..b657c85 100644 --- a/recipes-kernel/linux/linux-raspberrypi_4.1.bb +++ b/recipes-kernel/linux/linux-raspberrypi_4.1.bb @@ -1,6 +1,8 @@ LINUX_VERSION ?= "4.1.10" SRCREV = "b74df9228c27f55361c065bc5dbfba88861cc771" -SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.1.y" +SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.1.y + file://0001-dts-add-overlay-for-pitft22.patch [3] + " require linux-raspberrypi.inc
Quoted 4 lines
Cheers Peter!
Based on this patch I
pushed a v4:
Quoted 2 lines
- resolve conflicts
- use patches specific for a
certain kernel version in separate directories -
Quoted 7 lines
easier to visualize
What do you think?
--
Andrei Gherzan
Hi Andrei,
I think it
makes sense. Please go ahead with these changes.
BR Petter
Petter
Mabäcker
Technux <[email protected]>
www.technux.se
Links:
------
[1]
https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic
[2] file://0001-dts-add-overlay-for-pitft22-in-linux-3.18.patch
[3]
file://0001-dts-add-overlay-for-pitft22.patch